package com.zmn.plat.services.interfaces.extension.serv.category;

import java.util.List;

import com.zmn.plat.model.entity.extension.serv.category.ExtensionServCategoryAssociation;
import com.zmn.plat.model.entity.extension.serv.category.ExtensionServCategoryAssociationQuery;
import com.zmn.plat.model.vo.extension.serv.category.ExtensionServCategoryAssociationVO;

/**
 * 服务推广分类service
 *
 * @author linfeng
 * @since 2019-12-24 10:55:48
 */
public interface ExtensionServCategoryAssociationService {
    /**
     * 描述: ExtensionServCategoryAssociation key 查询数据
     *
     * @param relateId
     * @return: ExtensionServCategoryAssociation
     * @auther: linfeng
     * @since: 2019/12/30 16:41
     */
    ExtensionServCategoryAssociation findByKey(Integer relateId);

    /**
     * 描述:查询最大key
     *
     * @return: relateId
     * @auther: linfeng
     * @since: 2019/12/30 16:41
     */
    Integer findKeyForMax();

    /**
     * 描述: 根据查询条件分页查询
     *
     * @param query
     * @return: List<ExtensionServCategoryAssociation>
     * @auther: linfeng
     * @since: 2019/12/30 16:41
     */
    List<ExtensionServCategoryAssociation> listPageByQuery(ExtensionServCategoryAssociationQuery query);

    /**
     * 描述: 根据查询条件查询所有数据
     *
     * @param query
     * @return: List<ExtensionServCategoryAssociation>
     * @auther: linfeng
     * @since: 2019/12/30 16:41
     */
    List<ExtensionServCategoryAssociation> listByQuery(ExtensionServCategoryAssociationQuery query);

    /**
     * 描述: ExtensionServCategoryAssociation 数据
     *
     * @return: List<ExtensionServCategoryAssociation>
     * @auther: linfeng
     * @since: 2019/12/30 16:41
     */
    List<ExtensionServCategoryAssociation> listAll();

    /**
     * 描述: 根据前台分类ID查询后台分类关联关系，参数不能同时为空
     *
     * @param extensionServCategId
     *            推广服务分类ID
     * @param extensionCategId
     *            推广分类ID
     * @param categId
     *            后台二级产品分类ID
     * @return List<ExtensionServCategoryAssociationVO> 推广分类关联关系
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    List<ExtensionServCategoryAssociationVO> listByExtensionServCategoryId(Integer extensionServCategId, Integer extensionCategId, Integer categId);

    /**
     * 描述: 根据查询条件统计满足条件的数据条数
     *
     * @param query
     * @return: Integer
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    Integer countByQuery(ExtensionServCategoryAssociationQuery query);

    /**
     * 描述: 根据主键修改数据
     *
     * @param extensionServCategoryAssociation
     * @return: 执行结果码
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    Integer updateByKey(ExtensionServCategoryAssociation extensionServCategoryAssociation);

    /**
     * 描述: 新增数据
     *
     * @param extensionServCategoryAssociation
     * @return: 执行结果码
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    Integer insert(ExtensionServCategoryAssociation extensionServCategoryAssociation);

    /**
     * 批量插入前后台产品关联关系
     * 
     * @param extensionServCategoryAssociationList
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    Integer insertBatch(List<ExtensionServCategoryAssociation> extensionServCategoryAssociationList);

    /**
     * 描述: 根据主键删除数据
     *
     * @param relateId
     * @return: 执行结果码
     * @auther linfeng
     * @since 2019/12/30 11:20
     */
    Integer deleteByKey(Integer relateId);

    /**
     * 根据推广服务分类ID和推广分类ID删除对应后台关联的关联关系
     * 
     * @param extensionServCategId
     * @param extensionCategId
     * @return
     */
    Integer deleteByExtensionServCategId(Integer extensionServCategId, Integer extensionCategId);

    /**
     * 通过推广服务分类ID和推广分类ID批量删除推广分类关联关系
     * 
     * @param ids
     * @return
     */
    Integer deleteByServCategIdAndExtensionCategId(String[] ids);
}
